package com.blank.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "Login")
public class LoginController {

	@RequestMapping(value = "index")
	public ModelAndView index(ModelAndView modelAndView) {

		return modelAndView;

	}

	@RequestMapping(value = "doLogin")
	public ModelAndView doLogin(String username, String password, ModelAndView modelAndView,HttpSession session) {
		if (username.equals("jmyxcz") && password.equals("jmyxcz888")) {
			session.setAttribute("userToken","success");
			modelAndView.setViewName("redirect:/Express/addRecord");
			return modelAndView;
		} else
			return null;

	}

}
